<?php

class prihlasenie_model extends MY_Model 
{
	public function __construct() 
	{
		parent::__construct();
	}
	
	public function loginCustomer($email)
	{
		try
		{
			$instance = DbPdo::getInstance();
			$statement = $instance->prepare( "SELECT id, name, surname, passwordhash, passwordsalt, state, passwordtochange FROM customers WHERE emailaddress = :email");
			$statement->bindParam( ":email", $email, PDO::PARAM_STR );
			$statement->execute();
			$result = $statement->fetch( PDO::FETCH_OBJ );
			return $result;
		}
		catch(PDOException $e)
		{
			$this->setErrorString(  __FUNCTION__ . ": " . $e->getMessage() );
			return false;
		}

		return true;
	}
}
?>
